import { useUserStoreWithOut } from '@/store/modules/user';

export default {
  created(el, binding) {
    const permissionVal = binding.value;
    if (permissionVal) {
      const userStore = useUserStoreWithOut();
      const permissionCodeMap: string[] = userStore.getPermissionCodeMap || [];
      //没有权限就先隐藏此元素
      if (permissionCodeMap && !permissionCodeMap.includes(permissionVal)) {
        el.style.display = 'none';
      }
    }
  }
};
